/**
 * 功能描述: 功能表格样式表
 * @author 崔孝楠
 * @date 2022/10/8 11:01
 * @version 1.0
 */
@import '../../style/index';

// table容器布局
@include b(table-wrapper) {
  clear: both;
  max-width: 100%;

  @include b(simple-pagination) {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0;
  }
}

// 过滤列头布局
@include b(table-filter-column) {
  display: flex;
  justify-content: space-between;
}

// 过滤图标布局
@mixin table-filter-trigger--layout {
  display: flex;
  align-items: center;
  margin: -4px -8px -4px 4px;
  padding: 0 4px;
}

// 过滤图标样式
@include b(table-filter-trigger) {
  color: #bfbfbf;
  font-size: 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .3s;
  @include table-filter-trigger--layout;
  // 悬浮时样式
  &:hover {
    color: #00000073;
    background: rgba(0,0,0,.04);
  }
}

// 过滤下拉框布局
@include b(table-filter-dropdown) {
  position: absolute;
  right: 8px;
  top: 80%;
  z-index: 100;
  // 下拉框菜单布局
  @include b(dropdown-menu) {
    min-width: 120px;
  }
}

// 过滤下拉框按钮布局
@mixin table-filter-dropdown-btns--layout {
  display: flex;
  justify-content: space-between;
  padding: 7px 8px;
  overflow: hidden;
}

// 过滤下拉框按钮样式
@include b(table-filter-dropdown-btns) {
  background-color: inherit;
  border-top: 1px solid #f0f0f0;
  @include table-filter-dropdown-btns--layout;
}

// 分类表头布局
@include b(table-column-sort) {
  display: flex;
  flex: auto;
  align-items: center;
  justify-content: space-between;
}

// 分类按钮布局
@mixin table-column-sorter-inner--layout {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-left: 4px;

  @include b(table-column-sorter-icon) {
    width: 1em;
    height: 1em;
  }
}

// 分类按钮样式
@include b(table-column-sorter-inner) {
  color: #bfbfbf;
  font-size: 12px;
  transition: color .3s;
  @include table-column-sorter-inner--layout;
  // 悬浮时样式
  &:hover {
    color: #a6a6a6;
  }
}

// 分类图标激活时颜色
@include b(table-column-sorter-icon-active) {
  color: $color-primary;
}

// 页头布局
@include b(table-title) {
  padding: 16px;
}

// 页尾布局
@mixin table-footer--layout {
  padding: 16px;
}

// 页尾样式
@include b(table-footer) {
  color: #000000d9;
  background: #fafafa;
  @include table-footer--layout;
}

// 带边框表格
@include b(table-bordered) {
  // 页头
  @include b(table-title) {
    border-bottom: 0;
  }

  // 页尾
  @include b(table-footer) {
    border-top: 0;
  }
}

// 选择框列
@include b(table-selection-col) {
  width: 32px;
}

// 固定列单元格样式
.#{$namespace}-table-cell-fix-left,
.#{$namespace}-table-cell-fix-right {
  z-index: 2;
  position: sticky !important;
  background: #fff;
}

// 左侧第一个固定列单元格
@include b(table-cell-fix-left-first) {
  left: 0px;
}

// 左侧最后一个固定列单元格布局
@mixin table-cell-fix-left-last--layout {
  left: 100px;

  &::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: -1px;
    width: 30px;
    transform: translate(100%);
  }
}

// 左侧最后一个固定列单元格样式
@include b(table-cell-fix-left-last) {
  @include table-cell-fix-left-last--layout;

  &::after {
    transition: box-shadow .3s;
    content: "";
    pointer-events: none;
  }
}

// 左侧最后一个固定列单元格布局
@mixin table-cell-fix-right-last--layout {
  right: 0px;

  &::after {
    position: absolute;
    top: 0;
    bottom: -1px;
    left: 0;
    width: 30px;
    transform: translate(-100%);
  }
}

// 右侧第一个固定列单元格样式
@include b(table-cell-fix-right-first) {
  @include table-cell-fix-right-last--layout;

  &::after {
    transition: box-shadow .3s;
    content: "";
    pointer-events: none;
  }
}

// 左侧固定与其他单元格间阴影
.#{$namespace}-table-cell-fix-left-last::after,
.#{$namespace}-table-cell-fix-left-first::after {
  box-shadow: inset 10px 0 8px -8px #00000026;
}


// 右侧固定与其他单元格间阴影
.#{$namespace}-table-cell-fix-right-last::after,
.#{$namespace}-table-cell-fix-right-first::after {
  box-shadow: inset -10px 0 8px -8px #00000026;
}

// 表格横向滑布局
@include b(table-scroll-horizontal) {
  overflow: hidden;
  // 表格
  table {
    table-layout: fixed;
  }
  // 表头
  @include b(table-thead) {
    overflow: auto;
  }
  // 表内容
  @include b(table-body) {
    overflow: auto;
    max-height: 300px;
    min-width: 100%;
  }
}

// 单元格内a标签颜色
@include b(table-cell) {
  a {
    color: $color-primary;
  }
}

// 隐藏行布局
@mixin table-measure-row--layout {
  height: 0px;

  td {
    padding: 0px !important;
    height: 0px;

    div {
      height: 0px;
      overflow: hidden;
    }
  }
}

// 隐藏行样式
@include b(table-measure-row) {
  font-size: 0px;
  @include table-measure-row--layout;
  td {
    border: 0px none;
  }
}


